package pl.project.engineering.data;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import pl.project.engineering.entities.AlertEmailAddress;

/**
 *
 * @author iKrzysiek
 */
public class AlertEmailAddressList {

  private Map<String, AlertEmailAddress> alertEmailAddresses = Maps.newHashMap();

  public void addAlertEmailAddress(AlertEmailAddress aea) {
    aea.id = UUID.randomUUID().toString();
    this.alertEmailAddresses.put(aea.id, aea);
  }

  public void deleteAlerEmailAddress(String id) {
    this.alertEmailAddresses.remove(id);
  }

  public List<AlertEmailAddress> getAlertEmailAddresses() {
    return Lists.newArrayList(this.alertEmailAddresses.values());
  }
}
